<%@ page language="java" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>My JSP 'updateForUser.jsp' starting page</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<style type="text/css">
			<!--
			body,td,th {
				font-size: 12px;
			}
.STYLE1 {color: #FF0000}
			-->
		</style>
		<script type="text/javascript">
			function checkSubmit()
			{
				var useracc = document.getElementById("useracc").value;
				if(useracc.length == 0)
				{
					alert("用户账号不能为空");
					return false;
				}
				
				var username = document.getElementById("username").value;
				if(username.length == 0)
				{
					alert("用户姓名不能为空");
					return false;
				}
				
				var userpass = document.getElementById("userpass").value;
				if(userpass.length == 0)
				{
					alert("用户密码不能为空");
					return false;
				}
				return true;
			}
		</script>
	</head>

	<body oncontextmenu="return false">
		<form name="userForm" method="post" action="<%=request.getContextPath() %>/user/updateForUser.action" onsubmit="return checkSubmit()">
			<input type="hidden" id="userid" name="userBean.userid" value="${userBean.userid}">
			<table width="80%" border="1" align="center" cellpadding="1"
				cellspacing="1">
				<tr>
					<td height="25" colspan="3" align="center">
						<span class="STYLE1">${errormessage }</span>					</td>
				</tr>
				<tr align="center">
					<td width="80" height="25">
						用户账号:					</td>
					<td height="25">
						<input name="userBean.useracc" type="text" id="useracc"
							style="width: 90%" value="${userBean.useracc}" maxlength="10">
					</td>
					<td width="10" height="25">
					<span class="STYLE1">*</span>					</td>
				</tr>
				<tr align="center">
					<td width="80" height="25">
						用户姓名:					</td>
					<td height="25">
						<input name="userBean.username" type="text" id="username"
							style="width: 90%" value="${userBean.username}" maxlength="10">
					</td>
					<td width="10" height="25" class="STYLE1">
						*					</td>
				</tr>
				<tr align="center">
					<td width="80" height="25">
						用户密码:					</td>
					<td height="25">
						<input name="userBean.userpass" type="password" id="userpass"
							style="width: 90%" value="${userBean.userpass}" maxlength="10">
					</td>
					<td width="10" height="25" class="STYLE1">
						*					</td>
				</tr>
				<tr align="center">
					<td width="80" height="25">
						用户类型:					</td>
					<td height="25">
						<select name="userBean.userstate" id="userstate"
							style="width: 90%">
							<option value="0"
								<c:if test="${userBean.userstate eq 0}">selected</c:if>>
								管理用户
							</option>
							<option value="1"
								<c:if test="${userBean.userstate eq 1}">selected</c:if>>
								普通用户
							</option>
						</select>
					</td>
					<td width="10" height="25">&nbsp;					</td>
				</tr>
				<tr>
					<td height="25" colspan="3" align="center">
						<input type="submit" value="提交">
						<input type="reset" value="重置">
						<input type="button" value="返回" onclick="javascript:window.history.back();">
					</td>
				</tr>
				<tr>
					<td height="25" colspan="3">&nbsp;
						

					</td>
				</tr>
		  </table>
		</form>
		<br>
	</body>
</html>
